Detailed Tables  and data for Account Management and Transaction Insights Case Study

Transactions Table
CREATE TABLE Transactions (
TransactionID NUMBER PRIMARY KEY,
AccountID NUMBER,
tDate DATE NOT NULL,
Amount NUMBER NOT NULL CHECK (Amount >= 0),
TransactionType VARCHAR2(20) NOT NULL,
FOREIGN KEY (AccountID) REFERENCES Accounts(AccountID)
);
INSERT INTO Transactions (TransactionID, AccountID, tDate, Amount, TransactionType)
VALUES (1, 1, TO_DATE('2023-01-01', 'YYYY-MM-DD'), 500.00, 'Deposit');


MySQL SQL

Customers Table

CREATE TABLE Customers (
 CustomerID INT PRIMARY KEY,
 Name VARCHAR(100) NOT NULL,
 Email VARCHAR(100) UNIQUE,
 Phone VARCHAR(15) NOT NULL,
 Address VARCHAR(255)
);
INSERT INTO Customers (CustomerID, Name, Email, Phone, Address)
VALUES (1, 'John Doe', 'john@example.com', '1234567890', '123 Elm St');

Accounts Table

CREATE TABLE Accounts (
  AccountID INT PRIMARY KEY,
 CustomerID INT,
 AccountType VARCHAR(20) NOT NULL,
 Balance DECIMAL(10, 2) DEFAULT 0 CHECK (Balance >= 0),
 FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID) );
INSERT INTO Accounts (AccountID, CustomerID, AccountType, Balance)
VALUES (1, 1, 'Savings', 1500.00);


Transactions Table

CREATE TABLE Transactions (
 TransactionID INT PRIMARY KEY,
 AccountID INT,
 tDate DATE NOT NULL,
 Amount DECIMAL(10, 2) NOT NULL CHECK (Amount >= 0),
 TransactionType VARCHAR(20) NOT NULL,
 FOREIGN KEY (AccountID) REFERENCES Accounts(AccountID) );
INSERT INTO Transactions (TransactionID, AccountID, tDate, Amount, TransactionType)
VALUES (1, 1, '2023-01-01', 500.00, 'Deposit');



Other Topic:-->>Conditional statement FAQ in C. || Next topic:-->>Retrive data using SELECT